using System;
using System.Configuration.Provider;

namespace Se.Framework.Common.Config.Providers
{
    public class TypeProviderCollection : ProviderCollection
    {
        public override void Add(ProviderBase provider)
        {
            if (provider == null)
                throw new ArgumentNullException("The provider parameter cannot be null.");

            if (!(provider is TypeProviderBase))
                throw new ArgumentException("The provider parameter must be of type TypeProviderBase.");

            base.Add(provider);
        }

        new public TypeProviderBase this[string name]
        {
            get
            {
                return (TypeProviderBase)base[name];
            }
        }
    }
}